﻿<UserControl x:Class="Core.Features.FillIn.PhoneNumberGame"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ctrl="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:tlk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignHeight="365" d:DesignWidth="480">
    <Grid x:Name="LayoutRoot">
        <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" StrokeThickness="2" Fill="DarkGray" 
		    Data="F1 M 243,89.3333L 538.46,89.3333L 538.46,256.138L 286.667,256.139L 288,280.833L 269.675,256.138L 242.987,256.138L 243,89.3333 Z " 
		    Margin="8" UseLayoutRounding="False"/>
        <ctrl:Pivot Name="mainPivot">
            <ctrl:PivotItem Header="{x:Null}" Margin="0,-100,0,0">
                <Grid Name="SetupGrid" Margin="11,30,11,57" VerticalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="Add Phone Number" FontSize="35" Margin="3" Foreground="Black"
                   HorizontalAlignment="Center" VerticalAlignment="Center"
                   MaxWidth="465" TextWrapping="Wrap" Grid.Row="0"/>
                    <TextBlock Text="example: 123-123-1234 (without dashes)" FontSize="23" Margin="3" Foreground="Black"
                   HorizontalAlignment="Center" VerticalAlignment="Center"
                   MaxWidth="465" TextWrapping="Wrap" Grid.Row="1"/>
                    <TextBox Grid.Row="2" TextAlignment="Center" Name="PhoneInput" />
                    <Button Grid.Row="3" Content="Submit" Command="{Binding CmdSubmitPhoneNumber}"
                            CommandParameter="{Binding ElementName=PhoneInput, Path=Text}"/>
                </Grid>
            </ctrl:PivotItem>
            <ctrl:PivotItem Header="{x:Null}" Margin="0,-100,0,0">
                <Grid Name="NumerGameGrid" VerticalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding FillInTitle}" FontSize="35" Margin="3" Foreground="Black"
                   HorizontalAlignment="Center" VerticalAlignment="Center"
                   MaxWidth="465" TextWrapping="Wrap" Grid.Row="0"/>
                    <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit4Idx, Mode=TwoWay}" ItemsSource="{Binding Digit4, Mode=TwoWay}"/>
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit5Idx, Mode=TwoWay}" ItemsSource="{Binding Digit5, Mode=TwoWay}" />
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit6Idx, Mode=TwoWay}" ItemsSource="{Binding Digit6, Mode=TwoWay}" />
                        <TextBlock Text="-" FontSize="40" Foreground="Black"  VerticalAlignment="Center" />
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit7Idx, Mode=TwoWay}" ItemsSource="{Binding Digit7, Mode=TwoWay}" />
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit8Idx, Mode=TwoWay}" ItemsSource="{Binding Digit8, Mode=TwoWay}" />
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit9Idx, Mode=TwoWay}" ItemsSource="{Binding Digit9, Mode=TwoWay}" />
                        <tlk:ListPicker Width="40" SelectionMode="Single" SelectedIndex="{Binding Digit10Idx, Mode=TwoWay}" ItemsSource="{Binding Digit10, Mode=TwoWay}" />
                    </StackPanel>
                    <Button Grid.Row="2" Content="Submit" Command="{Binding CmdSubmitGame}" />
                    <Button Content="X" HorizontalAlignment="Right" VerticalAlignment="Top"
                            Margin="0,-20,10,0" FontSize="15" Command="{Binding CmdXClose}" />
               </Grid>
            </ctrl:PivotItem>
            <ctrl:PivotItem Margin="0,-100,0,0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Perfect !" HorizontalAlignment="Center" VerticalAlignment="Bottom"
                               FontSize="60" Foreground="#00EF00"/>
                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock Text="{Binding CorrectResultSentence}" Foreground="Black"
                                   FontSize="20" HorizontalAlignment="Center"/>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                                    VerticalAlignment="Center">
                            <Button Content="Okay" Command="{Binding CmdResultOk}"/>
                        </StackPanel>
                    </Grid>
                </Grid>
            </ctrl:PivotItem>
            <ctrl:PivotItem Margin="0,-100,0,0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Incorrect . . ." HorizontalAlignment="Center" VerticalAlignment="Bottom"
                               FontSize="60" Foreground="#CF0000"/>
                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock Text="{Binding IncorrectResultDisplayPhoneNumber}"
                                   HorizontalAlignment="Center"
                                   FontSize="25" Grid.Row="0"/>
                        <TextBlock Text="{Binding IncorrectResultSentence}" Foreground="Black"
                                   FontSize="20" HorizontalAlignment="Center" Grid.Row="1"/>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                                    VerticalAlignment="Center" Grid.Row="2">
                            <Button Content="Okay" Command="{Binding CmdResultOk}"/>
                        </StackPanel>
                    </Grid>
                </Grid>
            </ctrl:PivotItem>
        </ctrl:Pivot>
    </Grid>
</UserControl>
